﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Brain
{
    public class MenuEntry_ISprite : MenuEntry
    {
        public ISprite Sprite;

        public MenuEntry_ISprite(ISprite sprite)
        {
            this.Sprite = sprite;
        }

        public override void Update()
        {
            base.Update();

            Sprite.Update();
            Sprite.Draw();
            Vector2 mousePos = Engine.Instance.InputManager.GetMousePosition();
            Rectangle mouseRect = new Rectangle((int)mousePos.X, (int)mousePos.Y, 1, 1);
            if (Sprite.BoundsRectangle.Contains(mouseRect) && Engine.Instance.InputManager.GetMouseDifference().Length() > 0)
            {
                this.System.SetSelected(X, Y);
            }   
        }
    }
}
